package com.jrx.mservices.ribbon.controller;

import com.jrx.mservices.ribbon.service.RibbonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 消费接口类
 *
 * @author zwg
 * @create 2018-03-06 17:35
 */
@RestController
@RequestMapping("ribbon")
public class RibbonController {

    @Autowired
    private RibbonService ribbonService;

    /**
     * 测试方法
     * @param waitTime  线程休眠时间 毫秒，默认为0，不休眠
     * @return
     */
    @RequestMapping("test")
    public String test(@RequestParam(defaultValue = "0") long waitTime){

        return ribbonService.callProvideTestFunc(waitTime);
    }

}
